<?php
/*
 +----------------------------------------------------------------------
 + Title        : ApiIdempotent 控制器
 + Author       : Randy_chen
 + Version      : V1.0.0.1
 + Initial-Time : 2020/5/5 16:11
 + Last-time    : 2020/5/5 16:11+ 86187
 + Desc         : ApiIdempotent
 +----------------------------------------------------------------------
*/


namespace app\http\behavior;


use think\Response;

class ApiIdempotent {
    public function run(Response $response) {
        $key = \request()->getApiKey();
        $data = cache($key);
        $responseData = $response->getData();
        if($data){
            $responseData['status'] = 1;
            cache($key ,$responseData);
        }
    }
}